<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>hexo主题配置及优化 | 一叶知秋</title><meta name="keywords" content="Hexo,butterfly"><meta name="author" content="一叶知秋"><meta name="copyright" content="一叶知秋"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一.安装主题1.安装主题类型butterfly，在博客根目录下1git clone -b master https:&#x2F;&#x2F;github.com&#x2F;jerryc127&#x2F;hexo-theme-butterfly.git themes&#x2F;Butterfly 2.在博客项目根目录_config.yml修改默认主题landscape1theme: butterfly 3.安装pug和stylus插件1npm i">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo主题配置及优化">
<meta property="og:url" content="https://liyezhixiu.github.io/post/hexo/3/index.html">
<meta property="og:site_name" content="一叶知秋">
<meta property="og:description" content="一.安装主题1.安装主题类型butterfly，在博客根目录下1git clone -b master https:&#x2F;&#x2F;github.com&#x2F;jerryc127&#x2F;hexo-theme-butterfly.git themes&#x2F;Butterfly 2.在博客项目根目录_config.yml修改默认主题landscape1theme: butterfly 3.安装pug和stylus插件1npm i">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img.alicdn.com/imgextra/i2/39767794/O1CN01br1hKN27RhfGzOpPL_!!39767794.png">
<meta property="article:published_time" content="2021-12-20T03:12:19.790Z">
<meta property="article:modified_time" content="2021-12-29T06:28:09.944Z">
<meta property="article:author" content="一叶知秋">
<meta property="article:tag" content="Hexo">
<meta property="article:tag" content="butterfly">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img.alicdn.com/imgextra/i2/39767794/O1CN01br1hKN27RhfGzOpPL_!!39767794.png"><link rel="shortcut icon" href="/img/website-logo.png"><link rel="canonical" href="https://liyezhixiu.github.io/post/hexo/3/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"top-right"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'hexo主题配置及优化',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-12-29 14:28:09'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/background.css"><link rel="stylesheet" href="/css/iconfont.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/macblack.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.zhimg.com/hexo-butterfly-clock/lib/clock.min.css" /><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="一叶知秋" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/img/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 文档</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 社交</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/debunk/"><i class="fa-fw iconfont icon-lament_fill"></i><span> 吐槽</span></a></li><li><a class="site-page child" href="/learningWebsite/"><i class="fa-fw iconfont icon-xuexi"></i><span> 学习网站</span></a></li><li><a class="site-page child" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-th-list"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fa fa-music"></i><span> 音乐</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">一叶知秋</a><div id="he-plugin-simple"></div></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 文档</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 社交</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/debunk/"><i class="fa-fw iconfont icon-lament_fill"></i><span> 吐槽</span></a></li><li><a class="site-page child" href="/learningWebsite/"><i class="fa-fw iconfont icon-xuexi"></i><span> 学习网站</span></a></li><li><a class="site-page child" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-th-list"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fa fa-music"></i><span> 音乐</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">hexo主题配置及优化</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-12-20T03:12:19.790Z" title="发表于 2021-12-20 11:12:19">2021-12-20</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-12-29T06:28:09.944Z" title="更新于 2021-12-29 14:28:09">2021-12-29</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Hexo/">Hexo</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Hexo/butterfly%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE/">butterfly主题配置</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">199</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>1分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="hexo主题配置及优化"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/post/hexo/3/#post-comment" itemprop="discussionUrl"><span class="valine-comment-count" data-xid="/post/hexo/3/" itemprop="commentCount"></span></a></span></div></div></div><article class="post-content" id="article-container"><h2 id="一-安装主题"><a href="#一-安装主题" class="headerlink" title="一.安装主题"></a>一.安装主题</h2><h3 id="1-安装主题类型butterfly，在博客根目录下"><a href="#1-安装主题类型butterfly，在博客根目录下" class="headerlink" title="1.安装主题类型butterfly，在博客根目录下"></a>1.安装主题类型butterfly，在博客根目录下</h3><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly</span><br></pre></td></tr></table></figure>
<h3 id="2-在博客项目根目录-config-yml修改默认主题landscape"><a href="#2-在博客项目根目录-config-yml修改默认主题landscape" class="headerlink" title="2.在博客项目根目录_config.yml修改默认主题landscape"></a>2.在博客项目根目录_config.yml修改默认主题landscape</h3><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">theme: <span class="title">butterfly</span></span></span><br></pre></td></tr></table></figure>
<h3 id="3-安装pug和stylus插件"><a href="#3-安装pug和stylus插件" class="headerlink" title="3.安装pug和stylus插件"></a>3.安装pug和stylus插件</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm i hexo-renderer-pug hexo-renderer-stylus --save</span><br></pre></td></tr></table></figure>
<h3 id="4-新建名一个-config-butterfly-yml文件，把-config-yml内容复制到其中"><a href="#4-新建名一个-config-butterfly-yml文件，把-config-yml内容复制到其中" class="headerlink" title="4.新建名一个_config.butterfly.yml文件，把_config.yml内容复制到其中"></a>4.新建名一个_config.butterfly.yml文件，把_config.yml内容复制到其中</h3><h3 id="5-配置导航栏"><a href="#5-配置导航栏" class="headerlink" title="5.配置导航栏"></a>5.配置导航栏</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">menu:</span><br><span class="line"> 主页: / || fas fa-home</span><br><span class="line"> 文档||fas fa-list: </span><br><span class="line">    归档: /archives/ || fas fa-archive</span><br><span class="line">    标签: /tags/ || fas fa-tags</span><br><span class="line">    分类: /categories/ || fas fa-folder-open</span><br><span class="line"> 友链: /link/ || fas fa-link</span><br><span class="line"> 关于: /about/ || fas fa-heart</span><br></pre></td></tr></table></figure>
<h3 id="6-进入-config-butterfly-yml文件，修改基本设置"><a href="#6-进入-config-butterfly-yml文件，修改基本设置" class="headerlink" title="6.进入_config.butterfly.yml文件，修改基本设置"></a>6.进入_config.butterfly.yml文件，修改基本设置</h3><p><img src= "" data-lazy-src="1.png"></p>
<h2 id="二-butterfly主题样式修改"><a href="#二-butterfly主题样式修改" class="headerlink" title="二.butterfly主题样式修改"></a>二.butterfly主题样式修改</h2><h3 id="1-进入butterfly主题中css，新建一个background-css"><a href="#1-进入butterfly主题中css，新建一个background-css" class="headerlink" title="1.进入butterfly主题中css，新建一个background.css"></a>1.进入butterfly主题中css，新建一个background.css</h3><p><img src= "" data-lazy-src="2.png"></p>
<h3 id="2-进入-config-butterfly-yml文件，引入background-css"><a href="#2-进入-config-butterfly-yml文件，引入background-css" class="headerlink" title="2.进入_config.butterfly.yml文件，引入background.css"></a>2.进入_config.butterfly.yml文件，引入background.css</h3><p><img src= "" data-lazy-src="3.png"></p>
<h3 id="3-修改自己想修改的样式，如博客底部样式"><a href="#3-修改自己想修改的样式，如博客底部样式" class="headerlink" title="3.修改自己想修改的样式，如博客底部样式"></a>3.修改自己想修改的样式，如博客底部样式</h3><p><img src= "" data-lazy-src="4.png"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">一叶知秋</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://liyezhixiu.github.io/post/hexo/3/">https://liyezhixiu.github.io/post/hexo/3/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://LiYeZhiXiu.github.io" target="_blank">一叶知秋</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Hexo/">Hexo</a><a class="post-meta__tags" href="/tags/butterfly/">butterfly</a></div><div class="post_share"><div class="social-share" data-image="https://img.alicdn.com/imgextra/i2/39767794/O1CN01br1hKN27RhfGzOpPL_!!39767794.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/post/node/1/"><img class="prev-cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i2/39767794/O1CN01RJcP1r27Rhf9yAXFr_!!39767794.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">node.js安装及配置环境变量</div></div></a></div><div class="next-post pull-right"><a href="/post/hexo/2/"><img class="next-cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i1/39767794/O1CN0154cL4y27RhfCl3HtH_!!39767794.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Hexo源码上传GitHub</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/post/hexo/4/" title="hexo之butterfly添加valine评论系统"><img class="cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i2/39767794/O1CN01ctL3T227RhfQRQLE8_!!39767794.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-24</div><div class="title">hexo之butterfly添加valine评论系统</div></div></a></div><div><a href="/post/hexo/1/" title="Hexo博客实现流程"><img class="cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i3/39767794/O1CN01Lx9mLd27RhfEmQ3Eq_!!39767794.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-20</div><div class="title">Hexo博客实现流程</div></div></a></div><div><a href="/post/hexo/2/" title="Hexo源码上传GitHub"><img class="cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i1/39767794/O1CN0154cL4y27RhfCl3HtH_!!39767794.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-20</div><div class="title">Hexo源码上传GitHub</div></div></a></div><div><a href="/post/hexo/5/" title="Hexo中安装音乐播放器插件及使用"><img class="cover" src= "" data-lazy-src="https://img.alicdn.com/imgextra/i1/39767794/O1CN01LDOH0S27RhfW8bA3i_!!39767794.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-28</div><div class="title">Hexo中安装音乐播放器插件及使用</div></div></a></div><div><a href="/post/hexo/6/" title="Hexo中标签外挂使用"><img class="cover" src= "" data-lazy-src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-12-28</div><div class="title">Hexo中标签外挂使用</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="/img/avatar.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">一叶知秋</div><div class="author-info__description">to be or not to be,this is a problem</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/LiYeZhiXiu"><i class="fab fa-github"></i><span>Github</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="/atom.xml" target="_blank" title="RSS链接"><i class="fa fa-rss"></i></a><a class="social-icon" href="https://gitee.com/huyimin1998" target="_blank" title="Gitee"><i class="iconfont icon-gitee"></i></a><a class="social-icon" href="https://blog.csdn.net/HuYiMin1998" target="_blank" title="我的CSDN"><i class="fa fa-address-card"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">一朝尘尽光生，照破山河万朵。</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%80-%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98"><span class="toc-number">1.</span> <span class="toc-text">一.安装主题</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98%E7%B1%BB%E5%9E%8Bbutterfly%EF%BC%8C%E5%9C%A8%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E4%B8%8B"><span class="toc-number">1.1.</span> <span class="toc-text">1.安装主题类型butterfly，在博客根目录下</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E5%9C%A8%E5%8D%9A%E5%AE%A2%E9%A1%B9%E7%9B%AE%E6%A0%B9%E7%9B%AE%E5%BD%95-config-yml%E4%BF%AE%E6%94%B9%E9%BB%98%E8%AE%A4%E4%B8%BB%E9%A2%98landscape"><span class="toc-number">1.2.</span> <span class="toc-text">2.在博客项目根目录_config.yml修改默认主题landscape</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E5%AE%89%E8%A3%85pug%E5%92%8Cstylus%E6%8F%92%E4%BB%B6"><span class="toc-number">1.3.</span> <span class="toc-text">3.安装pug和stylus插件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E6%96%B0%E5%BB%BA%E5%90%8D%E4%B8%80%E4%B8%AA-config-butterfly-yml%E6%96%87%E4%BB%B6%EF%BC%8C%E6%8A%8A-config-yml%E5%86%85%E5%AE%B9%E5%A4%8D%E5%88%B6%E5%88%B0%E5%85%B6%E4%B8%AD"><span class="toc-number">1.4.</span> <span class="toc-text">4.新建名一个_config.butterfly.yml文件，把_config.yml内容复制到其中</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-%E9%85%8D%E7%BD%AE%E5%AF%BC%E8%88%AA%E6%A0%8F"><span class="toc-number">1.5.</span> <span class="toc-text">5.配置导航栏</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-%E8%BF%9B%E5%85%A5-config-butterfly-yml%E6%96%87%E4%BB%B6%EF%BC%8C%E4%BF%AE%E6%94%B9%E5%9F%BA%E6%9C%AC%E8%AE%BE%E7%BD%AE"><span class="toc-number">1.6.</span> <span class="toc-text">6.进入_config.butterfly.yml文件，修改基本设置</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C-butterfly%E4%B8%BB%E9%A2%98%E6%A0%B7%E5%BC%8F%E4%BF%AE%E6%94%B9"><span class="toc-number">2.</span> <span class="toc-text">二.butterfly主题样式修改</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E8%BF%9B%E5%85%A5butterfly%E4%B8%BB%E9%A2%98%E4%B8%ADcss%EF%BC%8C%E6%96%B0%E5%BB%BA%E4%B8%80%E4%B8%AAbackground-css"><span class="toc-number">2.1.</span> <span class="toc-text">1.进入butterfly主题中css，新建一个background.css</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E8%BF%9B%E5%85%A5-config-butterfly-yml%E6%96%87%E4%BB%B6%EF%BC%8C%E5%BC%95%E5%85%A5background-css"><span class="toc-number">2.2.</span> <span class="toc-text">2.进入_config.butterfly.yml文件，引入background.css</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E4%BF%AE%E6%94%B9%E8%87%AA%E5%B7%B1%E6%83%B3%E4%BF%AE%E6%94%B9%E7%9A%84%E6%A0%B7%E5%BC%8F%EF%BC%8C%E5%A6%82%E5%8D%9A%E5%AE%A2%E5%BA%95%E9%83%A8%E6%A0%B7%E5%BC%8F"><span class="toc-number">2.3.</span> <span class="toc-text">3.修改自己想修改的样式，如博客底部样式</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/post/md/" title="md"><img src= "" data-lazy-src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="md"/></a><div class="content"><a class="title" href="/post/md/" title="md">md</a><time datetime="2021-12-29T06:36:08.000Z" title="发表于 2021-12-29 14:36:08">2021-12-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/hexo/6/" title="Hexo中标签外挂使用"><img src= "" data-lazy-src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo中标签外挂使用"/></a><div class="content"><a class="title" href="/post/hexo/6/" title="Hexo中标签外挂使用">Hexo中标签外挂使用</a><time datetime="2021-12-28T10:50:10.000Z" title="发表于 2021-12-28 18:50:10">2021-12-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/hexo/5/" title="Hexo中安装音乐播放器插件及使用"><img src= "" data-lazy-src="https://img.alicdn.com/imgextra/i1/39767794/O1CN01LDOH0S27RhfW8bA3i_!!39767794.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo中安装音乐播放器插件及使用"/></a><div class="content"><a class="title" href="/post/hexo/5/" title="Hexo中安装音乐播放器插件及使用">Hexo中安装音乐播放器插件及使用</a><time datetime="2021-12-28T07:06:45.000Z" title="发表于 2021-12-28 15:06:45">2021-12-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/hexo/4/" title="hexo之butterfly添加valine评论系统"><img src= "" data-lazy-src="https://img.alicdn.com/imgextra/i2/39767794/O1CN01ctL3T227RhfQRQLE8_!!39767794.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="hexo之butterfly添加valine评论系统"/></a><div class="content"><a class="title" href="/post/hexo/4/" title="hexo之butterfly添加valine评论系统">hexo之butterfly添加valine评论系统</a><time datetime="2021-12-24T08:01:11.987Z" title="发表于 2021-12-24 16:01:11">2021-12-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/node/1/" title="node.js安装及配置环境变量"><img src= "" data-lazy-src="https://img.alicdn.com/imgextra/i2/39767794/O1CN01RJcP1r27Rhf9yAXFr_!!39767794.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="node.js安装及配置环境变量"/></a><div class="content"><a class="title" href="/post/node/1/" title="node.js安装及配置环境变量">node.js安装及配置环境变量</a><time datetime="2021-12-20T03:12:19.921Z" title="发表于 2021-12-20 11:12:19">2021-12-20</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By 一叶知秋</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">歡迎來到我的博客</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>if (document.getElementsByClassName('mermaid').length) {
  if (window.mermaidJsLoad) mermaid.init()
  else {
    getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(() => {
      window.mermaidJsLoad = true
      mermaid.initialize({
        theme: 'default',
      })
      false && mermaid.init()
    })
  }
}</script><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'inLysXS1lp5pPgBhmphg9J1r-MdYXbMMI',
      master:'bad6875c6784f3fd6edd29e6ed676a78',//博主邮箱md5
      tagMeta: ["博主","小伙伴","访客"],     //标识字段名
      friends: [],  //小伙伴邮箱Md5
      appKey: 'xoKcgXAv2vnDSdC1JyPHh5JO',
      placeholder: '请留下你的痕迹',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: 'https://inlysxs1.api.lncldglobal.com',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: true,
      path: window.location.pathname,
      requiredFields: ["nick,mail"],
      visitor: true
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !false) {
  if (false) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script src="/js/fairyDustCursor.js"></script><script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script><script src="/js/weather.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_clock_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src= "" data-lazy-src="https://unpkg.zhimg.com/hexo-butterfly-clock/lib/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
    console.log('已挂载butterfly_clock')
    parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  var elist = '/posts/,/about/'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_clock_injector_config();
  }
  else if (epage === cpage){
    butterfly_clock_injector_config();
  }
  </script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax src="https://unpkg.zhimg.com/hexo-butterfly-clock/lib/clock.min.js"></script><!-- hexo injector body_end end --></body></html>